package addressBook;

import java.util.HashMap;
import java.io.*;

public class AddressBook {

	private HashMap<String,Address> addresses;
	
	public AddressBook() throws IOException {
		addresses = new HashMap<String,Address>();
	}
	
	public void addEntry(String name, Address address) {
		addresses.put(name, address);
	}
	
	public void deleteEntry() {
		
	}
	
	
	public void deleteEntry(String name) {
		addresses.remove(name);
	}
	
	public void displayContents() {
		for (String name : addresses.keySet()) {
			System.out.print(name+" lives at ");
			System.out.println(addresses.get(name));
		}
	}
	
	public void go() throws IOException {
		String input;
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		System.out.println("Choose to 1:Add Entry 2:Delete Entry 3:Display Contents");
		Boolean select = true;
		while(select) {
			input = br.readLine();
			if (input == "1") {
				
				select = false;
			}else if (input == "2") {
				
				select = false;
			}else if (input == "3") {
				
				select = false;
			}else {
				System.out.println("Selection not allowed, please try again.");
			}
		}
			
		
		
	}
}
